package com.javaee.term.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.javaee.term.Enums.ContactStatusEnum;
import com.javaee.term.Enums.SendProductStatusEnum;
import com.javaee.term.utils.EnumUtil;

import javax.persistence.*;

@Table(name = "send_product_list")
public class SendProductList {
    /**
     * 发货单表主键
     */
    @Id
    @Column(name = "send_id")
    private String sendId;

    @Column(name = "contact_id")
    private String contactId;

    @Column(name = "product_id")
    private String productId;

    /**
     * 数量
     */
    @Column(name = "product_quantity")
    private Integer productQuantity;

    @Column(name = "finsh_status")
    private Integer finshStatus= SendProductStatusEnum.REQUIRESEND.getCode();

    /**
     * 获取发货单表主键
     *
     * @return send_id - 发货单表主键
     */
    public String getSendId() {
        return sendId;
    }

    /**
     * 设置发货单表主键
     *
     * @param sendId 发货单表主键
     */
    public void setSendId(String sendId) {
        this.sendId = sendId == null ? null : sendId.trim();
    }

    /**
     * @return contact_id
     */
    public String getContactId() {
        return contactId;
    }

    /**
     * @param contactId
     */
    public void setContactId(String contactId) {
        this.contactId = contactId == null ? null : contactId.trim();
    }

    /**
     * @return product_id
     */
    public String getProductId() {
        return productId;
    }

    /**
     * @param productId
     */
    public void setProductId(String productId) {
        this.productId = productId == null ? null : productId.trim();
    }

    /**
     * 获取数量
     *
     * @return product_quantity - 数量
     */
    public Integer getProductQuantity() {
        return productQuantity;
    }

    /**
     * 设置数量
     *
     * @param productQuantity 数量
     */
    public void setProductQuantity(Integer productQuantity) {
        this.productQuantity = productQuantity;
    }

    /**
     * @return finsh_status
     */
    public Integer getFinshStatus() {
        return finshStatus;
    }

    /**
     * @param finshStatus
     */
    public void setFinshStatus(Integer finshStatus) {
        this.finshStatus = finshStatus;
    }
    @JsonIgnore
    public SendProductStatusEnum getSendProductStatusEnum() {
        return EnumUtil.getByCode(finshStatus, SendProductStatusEnum.class);
    }

}